package com.golang.api.controller;

import com.golang.api.dto.request.TagInfoDto;
import com.golang.api.dto.request.TagSearchDto;
import com.golang.api.dto.response.TagListRespDto;
import com.golang.api.service.ITagService;
import com.golang.api.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/tag")
public class TagController {

    @Autowired
    private ITagService tagService;



    //获取列表
    @PostMapping(value = "/list")
    public Result<TagListRespDto> list(TagSearchDto query) {
        return tagService.list(query);
    }




    //创建基本信息
    @PostMapping(value = "/create")
    public Result<Long> create(TagInfoDto tag) {
        return tagService.create(tag);
    }


}
